import React from 'react';
import { WeaNewScroll, WeaInputSearch } from 'ecCom';
import { Pagination } from 'antd';
import ListItem from './ListItem';
import { WeaLocaleProvider } from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;

export default class ListView extends React.Component {

    render() {
        const { datas, pagination, scrollHeight = document.documentElement.clientHeight, currentKey } = this.props;
        return (
            <div className="task-list-view">
                {/* <WeaInputSearch
                    value={prjValue}
                    style={{ margin: '5px 15px', width: 'calc(100% - 30px)' }}
                    placeholder={getLabel('83788',"请输入关键字搜索")}
                    onSearch={onSearchListItem}
                    onSearchChange={onSearchChange}
                /> */}
                <WeaNewScroll ecId={`${this && this.props && this.props.ecId || ''}_WeaNewScroll@j79f6c`}
                    height={scrollHeight - 65}
                >
                    {datas.length === 0 ?
                        <p style={{ textAlign: 'center', color: '#999', marginTop: 10 }} >
                            <i className='icon-coms-Invalid' /> {getLabel('83553',"暂无数据")}
                 </p>
                        :
                        <div className="task-list-view-content">
                            {
                                datas && datas.length > 0 && datas.map(d => (
                                    <ListItem ecId={`${this && this.props && this.props.ecId || ''}_ListItem@9fejh6`} currentKey={currentKey} data={d} onClick={this.props.onItemClick} />
                                ))
                            }
                        </div>
                    }
                  
                </WeaNewScroll>
                <div >
                        <Pagination ecId={`${this && this.props && this.props.ecId || ''}_Pagination@ufioxb`}
                            {...pagination}
                            size="small"
                        />
                </div>
            </div>
        )
    }
}